// package: rewords-server-2024
// filename: admin
// author: diogoxiang@gmail.com
// time: 2024/11/12 17:51

package admin

import (
	"github.com/gogf/gf/v2/frame/g"
	"rewords-server-2024/internal/model/entity"
	"rewords-server-2024/internal/model/input/query_in"
)

type AmisSchemaListReq struct {
	g.Meta         `path:"/sys/amis/schema/query" method:"post" summary:"获取amis schema 列表" tags:"amis页面"`
	Conditions     []query_in.Condition  `json:"conditions,omitempty" summary:"查找条件"`   // 查找字段
	OrderFields    []query_in.OrderField `json:"order_fields,omitempty" summary:"排序字段"` // 排序字段
	*query_in.Page `json:"page"`
}

type AmisSchemaListRes struct {
	Data []entity.SysAmisSchema `json:"list"`
	query_in.PageResult
}

// AmisSchemaInfoReq  通过ID查找单个详情
type AmisSchemaInfoReq struct {
	g.Meta `path:"/sys/amis/schema/query_id" method:"get" summary:"获取amis schema 单个详情" tags:"amis页面"`
	Id     int64 `json:"id" v:"required#amis schema ID不能为空" dc:"amis schema ID"`
}
type AmisSchemaInfoRes struct{}

type AmisSchemaAddReq struct {
	g.Meta `path:"/sys/amis/schema/add" method:"post" summary:"添加amis schema" tags:"amis页面"`
	//entity.SysAmisSchema
	Name     string `json:"name" v:"required#名称不能为空" dc:"名称"`
	PathName string `json:"path_name" v:"required#路径不能为空" dc:"路径"`
	Remark   string `json:"remark" dc:"备注"`
}

type AmisSchemaAddRes struct {
	Id int64 `json:"id" summary:"amis schema ID"`
}

// AmisSchemaMiniReq  更新简单的配置项
type AmisSchemaMiniReq struct {
	g.Meta   `path:"/sys/amis/schema/mupdate" method:"put" summary:"添加amis schema" tags:"amis页面"`
	Id       int64  `json:"id" v:"required#配置ID不能为空" dc:"amis ID"`
	Name     string `json:"name" v:"required#名称不能为空" dc:"名称"`
	PathName string `json:"path_name" v:"required#路径不能为空" dc:"路径"`
	Remark   string `json:"remark" dc:"备注"`
	Status   string `json:"status" dc:"状态"`
}
type AmisSchemaMiniRes struct {
	Id int64 `json:"id" summary:"amis schema ID"`
}

// AmisSchemaUpdateReq  更新完整的配置项
type AmisSchemaUpdateReq struct {
	g.Meta `path:"/sys/amis/schema/update" method:"post" summary:"更新amis schema" tags:"amis页面"`
	Id     int64 `json:"id" v:"required#配置ID不能为空" dc:"amis ID"`
}

// AmisSchemaUpdateRes  更新完整的配置项
type AmisSchemaUpdateRes struct {
	Id int64 `json:"id" summary:"amis schema ID"`
}

type AmisSchemaDelReq struct {
	g.Meta `path:"/sys/amis/schema/del" method:"get" summary:"删除 amis schema" tags:"amis页面"`
	Id     int64 `json:"id" v:"required#配置ID不能为空" dc:"amis ID"`
}
type AmisSchemaDelRes struct{}

type AmisSchemaBatchUpdateReq struct {
	g.Meta `path:"/sys/amis/schema/batch_update" method:"post" summary:"批量更新amis schema" tags:"amis页面"`
	Rows   []map[string]any `json:"rows"`
}

type AmisSchemaBatchUpdateRes struct {
	Rows []int64 `json:"rows"`
}

// AmisPageReq 通过 url 中的 path 进行查询json , 主要适用于静态页面
type AmisPageReq struct {
	g.Meta `path:"/pages/*path" method:"get" summary:"通过 url 中的 path 进行查询json , 主要适用于静态页面" tags:"amis页面"`
}

type AmisPageRes struct{}

// AmisPageBuildReq 用于生成amis 页面json
type AmisPageBuildReq struct {
	g.Meta `path:"/sys/amis/schema/build" method:"get" summary:"生成amis 页面json" tags:"amis页面"`
}

type AmisPageBuildRes struct{}
